package com.dongxing.concyrrency.chapter2;

/**
 * 模拟银行叫号
 *
 * @author XavierDong
 **/
public class TicketWindow extends Thread {

    private final String name;

    public TicketWindow(String name) {
        this.name = name;
    }

    private static final int MAX = 50;

    private static int index = 1;

    @Override
    public void run() {
        while (index <= MAX) {
            System.out.println("柜台: " + this.name + "当前的号码是：" + (index++));
        }
    }
}
